<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
        let arr1=[1,2,3]
        let arr2=[4,5,6]
        let arr3=arr1.concat(arr2)

        console.log(arr3);

        //new Set()

      let arr4 = [1, 2, 3, 1, 2, 1, 2, 4, 3, 2, 1];

      //方法一
      let newObj = {};
      let newArr1 = arr4.filter((item, index) => {
        if (!newObj[item]) {
          newObj[item] = 1;
          return true;
        }
      });
      console.log(newObj);
      console.log(newArr1);

      //方法二
      let newArr = [...new Set(arr4)]

      console.log(newArr);
    </script>
  </body>
</html>
